// 数组的定义
const list: (string | number | object)[] = []
const array: Array<(string | number | object)> = [];

// 元组的定义
let enumList: [number, string, object] = [1, '2', {}]

// 枚举
enum Rules {
    MAX, // 0 序列号，自动获得
    MIN = 3, // 可以设置
}

// 对象类型
let target: object = {};

// 类型断言，表示可以把某个值强行指定为我们确定的类型
const getLength = (target: string | number): number | null => {
    if ((target as string).length || (target as string).length == 0) {
        return (<string>target).length;
    }
    return target.toString().length;
}

export {};